/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Principal.java
 *
 * Created on 15-jul-2012, 22:04:39
 */
package Vista;

import java.awt.Color;
import java.awt.Component;
import java.awt.Point;
import javax.swing.JPanel;
import Modelo.*;
import Modelo.Clases.*;
import java.util.List;

/**
 *
 * @author Home
 */
public class Principal extends javax.swing.JFrame {

    /** Creates new form Principal */
    private Color colorDefault ; 
    private Color colorSelected ; 
    
    
    
    public Principal() {
        initComponents();
        this.setLocationRelativeTo(null);
        this.setResizable(false);
        colorSelected = Color.orange;
        
        
         inicioJPanel panel = new inicioJPanel(940, 561);
        this.jPanel1.setVisible(false);
        this.jPanel1.removeAll();
    
         this.jPanel1.add(panel);
        this.jPanel1.setVisible(true);
       
       Principal.jButton1.setEnabled(false);
       Principal.jButton2.setEnabled(false);
       Principal.jButton3.setEnabled(false);
       Principal.jButton4.setEnabled(false);
       Principal.jButton5.setEnabled(false);
       Principal.jButton6.setEnabled(false);
       
    List<VideoConferencia> lista =  Modelo.consultarVideoConferencias();
    
    /*
     * aqui el proceso de actualizacion
     */
        
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel2 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jEImagePanel1 = new recursos.JEImagePanel();
        jButton6 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setForeground(new java.awt.Color(0, 204, 204));
        setResizable(false);

        jPanel2.setForeground(new java.awt.Color(51, 255, 255));
        jPanel2.setPreferredSize(new java.awt.Dimension(940, 700));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 940, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 561, Short.MAX_VALUE)
        );

        jEImagePanel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/recursos/magic-wind-blue.jpg"))); // NOI18N

        jButton6.setFont(new java.awt.Font("Snap ITC", 0, 14));
        jButton6.setForeground(new java.awt.Color(0, 153, 204));
        jButton6.setText("Solicitud");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jButton5.setFont(new java.awt.Font("Snap ITC", 0, 14));
        jButton5.setForeground(new java.awt.Color(0, 153, 204));
        jButton5.setText("Historial");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jButton4.setFont(new java.awt.Font("Snap ITC", 0, 14));
        jButton4.setForeground(new java.awt.Color(0, 153, 204));
        jButton4.setText("Familiar");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton3.setFont(new java.awt.Font("Snap ITC", 0, 14));
        jButton3.setForeground(new java.awt.Color(0, 153, 204));
        jButton3.setText("Anciano");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Snap ITC", 0, 14));
        jButton2.setForeground(new java.awt.Color(0, 153, 204));
        jButton2.setText("Amigos");
        jButton2.setPreferredSize(new java.awt.Dimension(130, 120));
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton1.setFont(new java.awt.Font("Snap ITC", 0, 14));
        jButton1.setForeground(new java.awt.Color(0, 153, 204));
        jButton1.setText("Administrador");
        jButton1.setPreferredSize(new java.awt.Dimension(130, 120));
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jButton1MouseExited(evt);
            }
        });
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jEImagePanel1Layout = new javax.swing.GroupLayout(jEImagePanel1);
        jEImagePanel1.setLayout(jEImagePanel1Layout);
        jEImagePanel1Layout.setHorizontalGroup(
            jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEImagePanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)
                .addGap(4, 4, 4)
                .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jEImagePanel1Layout.setVerticalGroup(
            jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEImagePanel1Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
                        .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)
                        .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE))))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jEImagePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jEImagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jMenu1.setText("Menu");
        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 687, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
    cambiarBoton(1);
   
    AdministradorJPanel panel = new AdministradorJPanel(940, 561);
    this.jPanel1.setVisible(false);
    this.jPanel1.removeAll();
    
    this.jPanel1.add(panel);
    this.jPanel1.setVisible(true);
    this.jPanel1.setSize(930, 581);
    this.jPanel2.setSize(930, this.getHeight());
    
    
}//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
    cambiarBoton(2);
        AmigoJPanel panel = new AmigoJPanel(940, 561);
    this.jPanel1.setVisible(false);
    this.jPanel1.removeAll();
    
    this.jPanel1.add(panel);
    this.jPanel1.setVisible(true);
    
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
            cambiarBoton(3);
        AncianoJPanel panel = new AncianoJPanel(940, 561);
        this.jPanel1.setVisible(false);
    this.jPanel1.removeAll();
    
    this.jPanel1.add(panel);
    this.jPanel1.setVisible(true);
    
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
        cambiarBoton(4); 
        FamiliarJPanel panel = new FamiliarJPanel(940, 561);
        this.jPanel1.setVisible(false);
    this.jPanel1.removeAll();
    
    this.jPanel1.add(panel);
    this.jPanel1.setVisible(true);
        
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        // TODO add your handling code here:
    cambiarBoton(5);    
        HistorialJPanel panel = new HistorialJPanel(940, 561);
        this.jPanel1.setVisible(false);
    this.jPanel1.removeAll();
    
    this.jPanel1.add(panel);
    this.jPanel1.setVisible(true);
    
        
    }//GEN-LAST:event_jButton5ActionPerformed

    
    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        // TODO add your handling code here:
        cambiarBoton(6);
        SolicitudJPanel panel = new SolicitudJPanel(940, 561);
       this.jPanel1.setVisible(false);
    this.jPanel1.removeAll();
    
    this.jPanel1.add(panel);
    this.jPanel1.setVisible(true);
    
        
    }//GEN-LAST:event_jButton6ActionPerformed

private void jButton1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseExited
// TODO add your handling code here:
    
}//GEN-LAST:event_jButton1MouseExited

    public void cambiarBoton(int numBoton){
    
        if(numBoton == 1){
        this.jButton1.setBackground(colorSelected);
        this.jButton2.setBackground(colorDefault);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        }
        if(numBoton == 2){
        this.jButton1.setBackground(colorDefault);
        this.jButton2.setBackground(colorSelected);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        }
        if(numBoton == 3){
        this.jButton1.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton3.setBackground(colorSelected);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        }
        if(numBoton == 4){
        this.jButton1.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorSelected);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorDefault);
        }
        if(numBoton == 5){
        this.jButton1.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorSelected);
        this.jButton6.setBackground(colorDefault);
        }
        if(numBoton == 6){
        this.jButton1.setBackground(colorDefault);
        this.jButton2.setBackground(colorDefault);
        this.jButton3.setBackground(colorDefault);
        this.jButton4.setBackground(colorDefault);
        this.jButton5.setBackground(colorDefault);
        this.jButton6.setBackground(colorSelected);
        }
        
    } 
   
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Principal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public static javax.swing.JButton jButton1;
    public static javax.swing.JButton jButton2;
    public static javax.swing.JButton jButton3;
    public static javax.swing.JButton jButton4;
    public static javax.swing.JButton jButton5;
    public static javax.swing.JButton jButton6;
    private recursos.JEImagePanel jEImagePanel1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    public static javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration//GEN-END:variables
}
